﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Yto.Common.Extensions
{
    public static class DictionaryExtensions
    {

        public static TV GetOrDefault<TK,TV>(this IDictionary<TK,TV> dictionary,TK tK)
        {
            TV obj;
            return dictionary.TryGetValue(tK, out obj) ? obj : default(TV);
        }
    }
}
